import request from '@/utils/request.js'

// 查询爬虫列表
export function listCrawler(query) {
    return request({
        url: '/crawler/list',
        method: 'get',
        params: query
    })
}

// 新增爬虫
export function addCrawler(data) {
    return request({
        url: '/crawler',
        method: 'post',
        data: data
    })
}

// 修改爬虫
export function updateCrawler(data) {
    return request({
        url: '/crawler/collect',
        method: 'put',
        data: data
    })
}

// 删除爬虫
export function delCrawler(collectId) {
    return request({
        url: '/crawler/' + collectId,
        method: 'delete'
    })
}

// 根据爬虫ID查询爬虫
export function queryCrawlerById(roleId) {
    return request({
        url: '/crawler/deptTree/' + roleId,
        method: 'get'
    })
}
